<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>农家乐大数据发布</title>
		<link href="__CSS__/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="__CSS__/iconfont.css" />
		<link rel="stylesheet" href="__CSS__/style.css" />
		<link rel="stylesheet" href="__CSS__/mall.css" />
		<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.3&key=ebc4693ac7f608307dc039bd33c39675"></script>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-icon mui-icon-left-nav mui-pull-left" href="JavaScript:history.go(-1)"></a>
			<h1 class="mui-title">农家乐大数据发布</h1>
		</header>
		<div class="mui-content ">
			<div class="gerenzl_nr">
				<form id="myForm" class="mui-input-group gerenzl_group">
					<div class="mui-input-row ">
						<label><em>*</em>农家乐名</label>
						<input type="text" name="name" value="{$model.name|default=''}" class="mui-input-group" placeholder="请填写农家乐名">
					</div>
					<div class="mui-input-row">
						<label><em>*</em>产品图</label>
						<div class="actions" style="float: right;">
							<div class="file-btn" style="border: 1px solid #CCCCCC;">
								<input type="hidden" id="thumb" name="thumb" value="{$model.thumb|default=''}">
								<input onchange="UpladFile('farmstay', 500)" type="file" accept="image/*" id="file" name="file" multiple>
								<span><img class='img_list' src="{$model.thumb|default='__IMG__/logo1.png'}" id='thumb_img' style="width: 100%;height: 100%;border-radius: 100%" ></span>
							</div>
						</div>
					</div>
					<div class="mui-input-row">
						<label><em>*</em>联系电话</label>
						<input type="text" name="mobile" value="{$model.mobile|default=''}" style="width: 65%;" class="mui-input-group" placeholder="请填写联系电话">
					</div>

					<div class="hy_line"></div>
					<div class="mui-input-row">
						<label><em>*</em>地区</label>
						<input type="text" readonly="" placeholder="请选择地区" id="myAddrs" data-key="{$model.area|default=''}" value="">
						<input type="hidden" id="area" name="area" value="{$model.area}" />
					</div>
					<div class="mui-input-row">
						<label><em>*</em>详细地址</label>
						<input type="text" name="address" value="{$model.address|default=''}" class="mui-input-group" placeholder="请填写详细地址">
					</div>
					<div class="mui-input-row">
						<label><em>*</em>服务特色：</label> {foreach name='cate' item='vo'}
						<div style="display: inline;margin-right: 25px; ">
							<input type="checkbox" name="cate_id[{$key}]" id="cate_id{$key}" value="{$vo.id}" {if in_array($vo.id,$model.cate_id)}checked{/if}/>
							<label for="cate_id{$key}" style="float: inherit; ">{$vo.name}</label>
						</div>
						{/foreach}
					</div>
					<div class="mui-input-row">
						<label>用餐可接待</label>
						<input type="text" name="reception" value="{$model.reception|default=''}" class="mui-input-group" placeholder="请填写多少人，填写数据就可以">
					</div>
					<div class="mui-input-row">
						<label>用餐已接待</label>
						<input type="text" name="reception1" value="{$model.reception1|default=''}" class="mui-input-group" placeholder="请填写多少人，填写数据就可以">
					</div>
					<div class="mui-input-row">
						<label>住宿容纳</label>
						<input type="text" name="accommodation" value="{$model.accommodation|default=''}" class="mui-input-group" placeholder="请填写多少人，填写数据就可以">
					</div>
					<div class="mui-input-row">
						<label>住宿已接待</label>
						<input type="text" name="accommodation1" value="{$model.accommodation1|default=''}" class="mui-input-group" placeholder="请填写多少人，填写数据就可以">
					</div>
					<div class="mui-input-row">
						<label><em>*</em>人均消费</label>
						<input type="text" name="consumption" value="{$model.consumption|default=''}" class="mui-input-group" placeholder="请填写多少元，填写数据就可以">
					</div>
					<div class="mui-input-row">
						<label><em>*</em>经营状态</label>
						<div style="text-align: right;">
							<div style="display: inline;margin-left: 25px;">
								<input type="radio" value="1" id="yes" name="status" {if $model.status==1}checked{/if}>&nbsp;&nbsp;<label for="yes" style="float: inherit; ">营业中</label>
							</div>
							<div style="display: inline;margin-left: 25px;">
								<input type="radio" value="2" id="no" name="status" {if $model.status==2}checked{/if}>&nbsp;&nbsp;<label for="no" style="float: inherit; ">休息中</label>
							</div>
						</div>
					</div>
					<div class="mui-input-row">
						<label>详细图片</label>
						<div class="ordpj_imgbox">
							<div id="img_list" class="img_list">
								{foreach name="$model.thumbs" item="vo"}
								<div style="display: block;float: left;margin-right: 5px;">
									<input value="{$vo}" type="hidden" name="thumbs[]" />
									<img src="{$vo}" style="width: 100px;height: 100px;" /><br>
									<a onclick="imgdel(this)">删除</a>
								</div>
								{/foreach}
							</div>
						</div>
						<div class="mui-input-row">
							<button class="file-btn">
				                <span><i class="mui-icon mui-icon-camera fa"></i></span>
				                <input onchange="UpladFiles('farmstay', 900)" type="file" accept="image/*" id="files" name="files" multiple>
				            </button>
						</div>
						<div class="mui-input-row">
							<label>备注</label>
							<textarea name="content" style="width:100%;height:150px;border: 1px solid #CCCCCC;">{$model.content|default=''}</textarea>
						</div>
						<div class="mui-input-row">
						<label>状态</label>
						<input type="text" disabled="disabled" class="mui-input-group" placeholder="{switch name="$model.auditing"} {case value="0"}未审核{/case} {default /}已审核 {/switch}">
					</div>
					<input class="lng" id="lng" name="lng" value="" hidden="hidden"/>
					<input class="lat" id="lat" name="lat" value="" hidden="hidden"/>
						<button type="submit" class="fjysq_sbtn">免费发布</button>
					</div>
				</form>
			</div>
		</div>
	</body>

</html>
<script src="__JS__/jquery.min.js"></script>
<script src="__JS__/jquery.validate.min.js"></script>
<script src="__JS__/mui.min.js"></script>
<script src="__LIB__/layer.js"></script>
<script src="__JS__/image.zip.js"></script>
<script src="__JS__/index.js"></script>
<link href="__JS__/scs.min.css" rel="stylesheet">
<script src="__JS__/jquery.scs.min.js"></script>
<script src="__JS__/district.js"></script>
<!-- 以下为编辑器-->
<script type="text/javascript">
	app.getmap();
	$(function() {
		$("#myForm").validate({
			focusInvalid: true,
			onkeyup: false,
			ignore: "",
			onfocusout: false,
			showErrors: function(errorMap, errorList) {
				var msg = "";
				if(errorList != null && errorList != "") {
					msg = errorList[0]['message'];
					layer.msg(msg);
				}
			},
			submitHandler: function(form) { //表单提交句柄,为一回调函数，带一个参数：form   
				if($("[id^='cate_id']").is(':checked')) {
					app.ajax();
				} else {
					layer.msg("请选择服务特色");
				}
			},
			rules: {
				name: {
					required: true
				},
				thumb: {
					required: true
				},
				mobile: {
					required: true
				},
				area: {
					required: true
				},
				address: {
					required: true
				}
			},
			messages: {
				name: {
					required: "请填写农家乐名称"
				},
				thumb: {
					required: "请上传门头照片"
				},
				mobile: {
					required: "请选择联系电话"
				},
				area: {
					required: "请选择地区"
				},
				address: {
					required: "请填写详细地址",
				}
			}
		});
	});
</script>